package com.han.school.controller;

import com.han.school.pojo.Achievements;
import com.han.school.service.AchiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class AchController {
        @Autowired
        private AchiService achiService;
        @RequestMapping("/insertAchi")
        @ResponseBody
        public String inserAchi(Achievements achievements){
                String insert = achiService.insert(achievements);
                return insert;
        }


        @RequestMapping("/findAllAch")
        @ResponseBody
        public List<Achievements> inserAchi(Integer month){
                List<Achievements> achievements = achiService.selectByMonth(month);
                return achievements;
        }
}
